import request from '../util/httpTool'
import DeviceSensorListWithReq from "../req/DeviceSensorListWithReq";
import {AxiosPromise} from "axios";
import DeviceSensorWith from "../res/DeviceSensorWith";
import DeviceSensorDataWithExplain from "../res/DeviceSensorDataWithExplain";
import DeviceSensorData from "../res/DeviceSensorData";

const basePath = 'iot/api/v1/v1/device/sensor/'

export function list(req: DeviceSensorListWithReq): Promise<DeviceSensorWith[]> {
    return new Promise<DeviceSensorWith[]>((resolve, reject) => {
        const res: any = request({
            url: basePath + 'list',
            method: 'post',
            data: req
        })
        res.then((data: DeviceSensorWith[]) => {
            resolve(data)
        }).catch((e: any) => {
            reject(e)
        })
    })
}


